package com.yupi.longojbackendquestionservice.rabbitmq;

import jakarta.annotation.Resource;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

/**
 * 消息队列生产者
 */
public class MyMessageProducer {


    @Resource
    private RabbitTemplate rabbitTemplate;

    /**
     * 发送消息
     * @param exchange
     * @param routingKey
     * @param message
     */
    public void sendMessage(String exchange,String routingKey,String message ){
        rabbitTemplate.convertAndSend(exchange,routingKey,message);
    }
}
